var _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
  return typeof e;
} : function (e) {
  return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
};

!function (e) {
  if ("object" == ("undefined" == typeof exports ? "undefined" : _typeof(exports)) && "undefined" != typeof module) module.exports = e();else if ("function" == typeof define && define.amd) define([], e);else {
    ("undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this).markdownitIns = e();
  }
}(function () {
  return function i(f, s, u) {
    function p(t, e) {
      if (!s[t]) {
        if (!f[t]) {
          var n = "function" == typeof require && require;
          if (!e && n) return n(t, !0);
          if (l) return l(t, !0);
          var o = new Error("Cannot find module '" + t + "'");
          throw o.code = "MODULE_NOT_FOUND", o;
        }

        var r = s[t] = {
          exports: {}
        };
        f[t][0].call(r.exports, function (e) {
          var n = f[t][1][e];
          return p(n || e);
        }, r, r.exports, i, f, s, u);
      }

      return s[t].exports;
    }

    for (var l = "function" == typeof require && require, e = 0; e < u.length; e++) p(u[e]);

    return p;
  }({
    1: [function (e, n, t) {
      n.exports = function (e) {
        e.inline.ruler.before("emphasis", "ins", function (e, n) {
          var t,
              o,
              r,
              i,
              f = e.pos,
              s = e.src.charCodeAt(f);
          if (n) return !1;
          if (43 !== s) return !1;
          if (r = (o = e.scanDelims(e.pos, !0)).length, i = String.fromCharCode(s), r < 2) return !1;

          for (r % 2 && (e.push("text", "", 0).content = i, r--), t = 0; t < r; t += 2) e.push("text", "", 0).content = i + i, e.delimiters.push({
            marker: s,
            jump: t,
            token: e.tokens.length - 1,
            level: e.level,
            end: -1,
            open: o.can_open,
            close: o.can_close
          });

          return e.pos += o.length, !0;
        }), e.inline.ruler2.before("emphasis", "ins", function (e) {
          var n,
              t,
              o,
              r,
              i,
              f = [],
              s = e.delimiters,
              u = e.delimiters.length;

          for (n = 0; n < u; n++) 43 === (o = s[n]).marker && -1 !== o.end && (r = s[o.end], (i = e.tokens[o.token]).type = "ins_open", i.tag = "ins", i.nesting = 1, i.markup = "++", i.content = "", (i = e.tokens[r.token]).type = "ins_close", i.tag = "ins", i.nesting = -1, i.markup = "++", i.content = "", "text" === e.tokens[r.token - 1].type && "+" === e.tokens[r.token - 1].content && f.push(r.token - 1));

          for (; f.length;) {
            for (t = (n = f.pop()) + 1; t < e.tokens.length && "ins_close" === e.tokens[t].type;) t++;

            n !== --t && (i = e.tokens[t], e.tokens[t] = e.tokens[n], e.tokens[n] = i);
          }
        });
      };
    }, {}]
  }, {}, [1])(1);
});